package com.example.demo.service.Impl;

import com.example.demo.dao.StudentMapper;
import com.example.demo.pojo.Student;
import com.example.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> findStudentByAge(Integer age) {

        return studentMapper.findStudentByAge(age);
    }

    @Override
    public boolean insertStudent(Student student) {
        return  studentMapper.insertStudent(student);
    }

    @Override
    public List<Student> selectStudentAll() {
        return studentMapper.selectStudentAll();
    }

   @Override
    public boolean deleteStudent(int id) {
        studentMapper.deleteStudent(id);
        return true;
    }

    @Override
    public boolean updateStudent(Student student) {
        studentMapper.updateStudent(student);
        return true;
    }
}
